<template>
  <div class="login-back">
    <div class="logo-box">
      <img src="@/assets/images/logo.png" alt="" />
      <div class="title">华能大连电厂</div>
    </div>
    <div class="container">
      <div class="flex_box">
        <div class="left">
          <img src="@/assets/image2/login-box-bg.svg" alt="" />
          <span>华能大连电厂巡检系统</span>
        </div>
        <div class="right">
          <div class="box" style="width: 60%">
            <LoginForm />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="js">
import LoginForm from "@/views/login/components/LoginForm.vue";
</script>

<style scoped lang="scss">
.container {
  padding: 0.5rem 2.5rem;
  height: 100%;
  width: 85%;
  margin-left: auto;
  margin-right: auto;
  position: relative;
  .flex_box {
    height: 100%;
    width: 100%;
    display: flex;
    .left {
      width: 50%;
      padding-left: 1rem;
      margin-right: 1rem;
      display: flex;
      flex-direction: column;
      justify-content: center;
      margin-bottom: 75px;
      img {
        margin-bottom: 40px;
        width: 50%;
        animation: enter-x-animation 0.4s ease-in-out 0.3s;
        animation-fill-mode: forwards;
        animation-delay: 0.1s;
      }
      span {
        font-size: 1.875rem;
        line-height: 2.25rem;
        color: white;
        margin-top: 1rem;
        font-weight: 500;
        border-width: 0;
        border-style: solid;
        animation: enter-x-animation 0.4s ease-in-out 0.3s;
        animation-fill-mode: forwards;
        animation-delay: 0.1s;
      }
    }
    .right {
      width: 50%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      margin-bottom: 75px;
      .box {
        display: flex;
        justify-content: center;
        flex-direction: column;
      }
    }
  }
}
.logo-box {
  position: fixed;
  top: 5%;
  left: 2%;
  height: 30px;
  display: flex;
  align-items: center;
  padding-left: 7px;
  cursor: pointer;
  img {
    width: 60px;
  }
  .title {
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    line-height: normal;
    margin-left: 0.5rem;
  }
}
.login-back {
  width: 100vw;
  height: 100vh;

  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin-left: -48%;
    background-image: url("@/assets/image2/login-bg.svg");
    background-repeat: no-repeat;
    background-position: 100%;
    background-size: auto 100%;
  }

  .login-form {
    position: relative;
    top: 50%;
    width: 50%;
  }
}
@keyframes enter-x-animation {
  from {
    transform: translateX(-100px); /* 初始状态，图片从左侧进入 */
    opacity: 0; /* 动画从透明开始 */
  }
  to {
    transform: translateX(0); /* 结束状态，图片回到正常位置 */
    opacity: 1; /* 结束时完全不透明 */
  }
}
</style>
